﻿#pragma once

#include <E_VersionControl.nanopb.h>

#include "NFServerComm/NFServerCommon/NFIDescStoreEx.h"
#include "NFServerComm/NFServerCommon/NFIDescTemplate.h"
#include "NFComm/NFShmStl/NFShmVector.h"
#include "NFLogicCommon/NFDescStoreTypeDefines.h"
#include "proto_common_role.pb.h"

class VersionControlDescEx : public NF_OBJECT_GLOBAL_TEMPLATE_MACRO(VersionControlDescEx, EOT_CONST_VERSIONCONTROL_DESC_EX_ID, NFIDescStoreEx)
public:
    VersionControlDescEx();

    virtual ~VersionControlDescEx();

    int CreateInit();

    int ResumeInit();

public:
    virtual int Load() override;

    virtual int CheckWhenAllDataLoaded() override;

public:
    static int ParseVersion(const std::string &versionStr, VersionDesc &stVersion);

    bool IsValidPlatType(int iPlatType) { return (iPlatType == (int) proto_ff::E_PLAT_ANDROID) || (iPlatType == (int) proto_ff::E_PLAT_IOS); }

    const E_VersionControlVersionControl *GetDescByWorldIdZoneIdPlatType(int64_t Worldid, int64_t Zoneid, int64_t iPlatType);
};
